#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void move(char a, char b)
{
	printf(" %c -> %c", a, b);
}
void hbt(int n, char a, char b, char c)
{
	if (n == 1)
		move(a, c);
	else
	{
		hbt(n - 1, a, c, b);
		move(a, c);
		hbt(n - 1, b, a, c);
	}

}
int main()
{
	hbt(1, 'A', 'B', 'C');
	return 0;
}